
// This is a bitmap class which contains the bitmap header 
// Color pixel map in rgb 


#ifndef BITMAP_H
#define BITMAP_H


#include<stdio.h>
#include<stdlib.h>
//#include<fstream>
#include<iostream>

using namespace std;



typedef struct                       /**** BMP file header structure ****/
	{
	unsigned short bfType;           /* Magic number for file */
	unsigned int   bfSize;           /* Size of file */
	unsigned short bfReserved1;      /* Reserved */
	unsigned short bfReserved2;      /* ... */
	unsigned int   bfOffBits;        /* Offset to bitmap data */
	} BITMAPFILEHEADER;

	
	typedef struct                       /**** BMP file info structure ****/
	{
	unsigned int   biSize;           /* Size of info header */
	int            biWidth;          /* Width of image */
	int            biHeight;         /* Height of image */
	unsigned short biPlanes;         /* Number of color planes */
	unsigned short biBitCount;       /* Number of bits per pixel */
	unsigned int   biCompression;    /* Type of compression to use */
	unsigned int   biSizeImage;      /* Size of image data */
	int            biXPelsPerMeter;  /* X pixels per meter */
	int            biYPelsPerMeter;  /* Y pixels per meter */
	unsigned int   biClrUsed;        /* Number of colors used */
	unsigned int   biClrImportant;   /* Number of important colors */
	} BITMAPINFOHEADER;


	typedef struct                       /**** Colormap entry structure ****/
	{
	unsigned char  rgbBlue;          /* Blue value */
	unsigned char  rgbGreen;         /* Green value */
	unsigned char  rgbRed;           /* Red value */
	unsigned char  rgbReserved;      /* Reserved */
	} RGBQUAD;

	typedef struct  BITMAPINFO          /**** Bitmap information structure ****/
	{
	BITMAPINFOHEADER bmiHeader;      /* Image header */
	RGBQUAD          bmiColors[256]; /* Image colormap */
	} ;
	

class bitmap{

        
        private:
	      BITMAPFILEHEADER bitmapfileheader;  
	      BITMAPINFO bitmapinfo;  
	      
        public:
	
	//constructor
	bitmap(char *fileName);
	bitmap();
	
	//destructor
	~bitmap();
	
	
	
	 RGBQUAD getRGB();
	 
	 bool printInfo();
	 
	 
	 

};


#endif
